/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.pages.member', [
        'App.pages.member.entrust'
    ]).config(routeConfig);

    function routeConfig($stateProvider) {
        $stateProvider.state('memberMenu', {
            url: "/member",
            abstract: true,
            templateUrl: 'source/pages/page-tab.html',
        }).state('memberMenu.addStudent', {
            url: "/addStudent",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/student/addStudent.html',
                    controller:'AddStudentCtrl as vm'
                }
            }
        }).state('memberMenu.parentIndex', {
            url: "/parentIndex",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/parent/index.html',
                    controller:'ParentCtrl as vm'
                }
            }
        }).state('memberMenu.parentInfo', {
            url: "/parentInfo/{studentId:string}",
            params: {
                studentId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/parent/parent-info.html',
                    controller:'ParentInfoCtrl as vm',
                    resolve: {
                        studentId: function($stateParams){
                            return $stateParams.studentId;
                        }
                    }
                }
            }
        }).state('memberMenu.albumIndex', {
            url: "/albumIndex",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/album/album-index.html',
                    controller:'AlbumCtrl as vm'
                }
            }
        }).state('memberMenu.albumCreate', {
            url: "/albumCreate",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/album/add-album.html',
                    controller:'AddAlbumCtrl as vm'
                }
            }
        }).state('memberMenu.chooseStudent', {
            url: "/chooseStudent?{nextState:string}",
            params: {
                nextState: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/student/chooseStudent.html',
                    controller:'ChooseStudentCtrl as vm'
                }
            }
        }).state('memberMenu.edit', {
            url: "/edit",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/info/member-edit.html',
                    controller:'MemberEditCtrl as vm'
                }
            }
        });
    }
})();